home *** CD-ROM | disk | FTP | other *** search
- /* index and xindex for translit, and other programs */
-
- /* find index of char c in string str */
-
- index(str,c)
- char c;
- char str[];
- {
- int ind;
-
- for(ind = 0; str[ind] != EOS ; ++ind)
- if(str[ind] == c)
- return(ind);
- return(-1);
- }
-
-
- /* handle index specially for translit */
- xindex(arr,c,allbut,lastto)
- int c;
- char arr[];
- int allbut,lastto;
- {
- int index();
-
- if(c == EOF)
- return(-1);
- else if(allbut == NO)
- return(index(arr,(char) c));
- else if(index(arr,(char) c)>-1)
- return(-1);
- else
- return(lastto + 1);
- }